]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Fix initial do-not-disturb state
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 18 May 2020 16:44:57 +0000 (18:44 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 18 May 2020 16:55:19 +0000 (18:55 +0200)
The do-not-disturb button and the contained switch are
tied together via a bidirectional property binding.

However it still matters which objects are used as source
and target, as that will determine the initial state: Right
now the (unchecked) button is used as source, which means
that do-not-disturb is turned off on startup.

We want the state to be preserved, so swap source and target
to let the switch (that is bound to the underlying GSetting)
control the initial state.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2804

js/ui/calendar.js

index 1a25dde256c86d0f737f6aa09aaf4e91167bcddc..35308c3597f03eab1a93b4e1dcacd092436030a1 100644 (file)
@@ -1199,8 +1199,8 @@ class CalendarMessageList extends St.Widget {
             child: this._dndSwitch,
             label_actor: dndLabel,
         });
-        this._dndButton.bind_property('checked',
-            this._dndSwitch, 'state',
+        this._dndSwitch.bind_property('state',
+            this._dndButton, 'checked',
             GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE);
         hbox.add_child(this._dndButton);